import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Recommendingmusic from './views/home/Recommendingmusic.vue'
import Hotsonglist from './views/home/Hotsonglist.vue'
import Search from './views/home/Search.vue'
import introduce from './views/home/Recommendpage/introduce.vue'
import play from './views/home/Playpage/play.vue'

Vue.use(Router)

export default new Router({
	mode: 'history',
	base: process.env.BASE_URL,
	routes: [{
			path: '/introduce/:id',
			name: 'introduce',
			component: introduce
		},
		{
			path: '/play/:id',
			name: 'play',
			component: play
		},
		{
			name: "home",
			alias: "/",
			path: "/home",
			component: Home,
			children: [{
					path: "recommendingmusic",
					component: Recommendingmusic,
					alias: ""
				},
				{
					path: "hotsonglist",
					component: Hotsonglist,
				},
				{
					path: "search",
					component: Search,
				}
			]}
	],
	scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})